home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / pubpoint_collection.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  35.2 KB  |  966 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsConstants.inc"-->
  3. <!--#include file="include/wmsLocStrings.inc"-->
  4. <!--#include file="include/wmsCommon.inc"-->
  5. <!--#include file="include/wmsHeader.inc"-->
  6. <!--#include file="include/wmsRefresh.inc"-->
  7. <!--#include file="include/wmsServerHash.inc"-->
  8. <!--#include file="include/wmsconnect.inc"-->
  9. <!--#include file="include/wmsError.inc"-->
  10. <!--#include file="include/wmsPageBanner.inc"-->
  11. <!--#include file="include/wmsToolbar.inc"-->
  12. <!--#include file="include/wmsHelp.inc"-->
  13. <% 
  14. '+-------------------------------------------------------------------------
  15. '
  16. '  Microsoft Windows Media
  17. '  Copyright (C) Microsoft Corporation. All rights reserved.
  18. '
  19. '  File:       PubPoint_Collection.asp
  20. '
  21. '  Contents:
  22. '
  23. '--------------------------------------------------------------------------
  24. if( 0 = Session( "PageReloadedToDisplayError" ) ) then
  25.     BeginErrorHandling 
  26. end if
  27. ConnectToServer
  28.  
  29. if( WMS_SERVICE_STARTED <> g_dwConnectionFailureCode ) then
  30.     Response.Redirect( "include/server_stopped.asp?server=" & qs("server") )
  31. elseif( empty = g_objServer ) then
  32. '    Server.Transfer( "pubpoint_collection.asp" )
  33.     Response.Redirect( "pubpoint_collection.asp?server=" & qs("server") & "&ppID=" & qs("ppID") & "&failCode=-2" )
  34. end if
  35.  
  36. Dim dwTabIndex
  37. Dim bArrivedFromServerSideTransfer
  38. Dim bCheckFirstPubPoint
  39. dwTabIndex = 1
  40. bCheckFirstPubPoint = FALSE
  41.  
  42. bArrivedFromServerSideTransfer = Session( "bUpdateTreeView" )
  43. Session( "bUpdateTreeView" ) = FALSE
  44. if( bArrivedFromServerSideTransfer ) then
  45.     Response.Redirect( "pubpoint_collection.asp?server=" & g_strQueryStringServer & "&bUpdateTree=true&ppID=" & qs("ppID") )
  46.     Response.Flush
  47. end if
  48.  
  49.  
  50. '////////////////////////////////////////////////////////////////
  51. Function CreateTabTitle( strServerName )
  52.     Dim strTemplate    
  53.     strTemplate = L_PUBLISHINGPOINTSTITLE_TEXT
  54.     CreateTabTitle = Replace( strTemplate, "___", Server.HTMLEncode( trim( strServerName ) ), 1 )
  55. End Function
  56.  
  57. '////////////////////////////////////////////////////////////////
  58. Function LabelValue( strValue, strLabel )
  59.     Dim strTemplate
  60.     strTemplate = strLabel
  61.     LabelValue = SpacesToNonbreak( Replace( RemoveDangerousCharacters( strTemplate ), "___", trim( CStr( strValue ) ), 1 ) )
  62. End Function
  63.  
  64. '//////////////////////////////////////////////////////////////////////////
  65. '
  66. ' Insert commas, where appropriate
  67. '
  68. function PrettyPrintNumber( dwNumPlayers )
  69.     Dim strRetVal
  70.     Dim strNumPlayers
  71.     Dim strTail
  72.     Dim lenStrNumPlayers
  73.     Dim lenStrTail
  74.     
  75.     if( -1 = dwNumPlayers ) then
  76.         strRetVal = " - "
  77.     else
  78.         strNumPlayers = CStr( dwNumPlayers )
  79.         lenStrNumPlayers = Len( strNumPlayers )
  80.         while( lenStrNumPlayers >= 3 )
  81.             strTail = Right( strNumPlayers, 3 )
  82.             lenStrTail = Len( strTail )
  83.             if( 0 < lenStrTail ) then
  84.                 strNumPlayers = Left( strNumPlayers, lenStrNumPlayers - lenStrTail )
  85.                 if( 3 <= Len( strRetVal ) ) then
  86.                     strRetVal = strTail & L_NUMDELIMITER_TEXT & strRetVal
  87.                 else
  88.                     strRetVal = strTail & strRetVal
  89.                 end if
  90.                 lenStrNumPlayers = Len( strNumPlayers )
  91.             end if
  92.         wend
  93.         if( ( 0 < Len( strNumPlayers ) ) and ( 3 <= Len( strRetVal ) ) ) then
  94.             strRetVal = strNumPlayers & L_NUMDELIMITER_TEXT & strRetVal
  95.         else
  96.             strRetVal = strNumPlayers & strRetVal
  97.         end if
  98.     end if
  99.     PrettyPrintNumber = SpacesToNonbreak( RemoveDangerousCharacters( strRetVal ) )
  100. end function
  101.  
  102.  
  103. '////////////////////////////////////////////////////////////////
  104. Function FormatStatusString( strPPName, strPPStatus )
  105.     Dim strFirstReplacement 
  106.     strFirstReplacement = Replace( L_PPPSTATTEMPL_TEXT, "_P_", trim( strPPName ), 1 )
  107.     FormatStatusString = Replace( strFirstReplacement, "_S_", Server.HTMLEncode( trim( strPPStatus ) ), 1 )
  108. End Function
  109.  
  110.  
  111. '////////////////////////////////////////////////////////////////
  112. Function InsertPPName( strPPName, strTemplate )
  113.     InsertPPName = Replace( strTemplate, "___", "'" & Server.HTMLEncode( trim( strPPName ) ) & "'", 1 )
  114. End Function
  115.  
  116.  
  117. '//////////////////////////////////////////////////////////////////////////
  118. '
  119. ' label with mbps and UNLIMITED
  120. '
  121. Function PrettyPrintBandwidth( dwBandwidth )
  122.     if( -1 = dwBandwidth ) then
  123.         PrettyPrintBandwidth = " - " 'L_UNLIMITED_TEXT
  124.     elseif( 1000 < dwBandwidth ) then
  125.         dwBandwidth = fix( dwBandwidth / 1000 )
  126.         if( 1000 < dwBandwidth ) then
  127.             dwBandwidth = fix( dwBandwidth / 1000 )
  128.             PrettyPrintBandwidth = LabelValue( PrettyPrintNumber( CStr( dwBandwidth ) ), RemoveDangerousCharacters( L_GIGABITSPERSEC_TEXT ) )
  129.         else
  130.             PrettyPrintBandwidth = LabelValue( PrettyPrintNumber( CStr( dwBandwidth ) ), RemoveDangerousCharacters( L_MEGABITSPERSEC_TEXT ) )
  131.         end if
  132.     else
  133.         PrettyPrintBandwidth = LabelValue( PrettyPrintNumber( CStr( dwBandwidth ) ), RemoveDangerousCharacters( L_KBITSPERSEC_TEXT ) )
  134.     end if
  135. End Function
  136.  
  137. WriteHTMLHeader( CreateTabTitle( g_strDecodedServerName ) ) %>
  138. <script language="JavaScript" src="include/WMSCommon.js"></script>
  139. <script language="JavaScript">
  140. <!--
  141. /*@cc_on @*/
  142. <% WriteCommonJSUtils %>
  143. -->
  144. </script>
  145. <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
  146. </head>
  147. <body topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0" onLoad="JavaScript:<% if ( "" <> qs("bUpdateTree") ) then %>UpdateTreeView();<% end if %>DrawCurrentToolbarSelection();Initialize();" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
  148. <table valign="top" width="100%" height="85" cellspacing="0" cellpadding="0" border="0" class="bannerName" <% if brMSIE <> g_dwBrowserType then %>bgproperties="fixed" bgcolor="#FFFFFF" background="img/gradient_tabview.png"<% end if %>>
  149. <% if brMSIE = g_dwBrowserType then %><img height="85" width="100%" src="img/gradient_tabview.png" style="position:absolute;top=0;left=0;z-index=-1"><% end if %>
  150. <tr>
  151.     <td>
  152.         <table valign="top" width="100%" hspace="0" vspace="0" cellspacing="4" cellpadding="1" border="0" style="BORDER-COLLAPSE: collapse" margin-top="0" margin-bottom="0">
  153.         <tr>
  154.             <td width="4">
  155.                  
  156.             </td>
  157.             <td valign="middle" align="left" width="32">
  158.                 <img src="img/pubpoints_32.gif" border="0" height=32 width=32>
  159.             </td>
  160.             <td width="4">
  161.                  
  162.             </td>
  163.             <td align="left" width="100%">
  164.                 <table width="100%" cellspacing="0" cellpadding="0" border="0">
  165.                 <tr>
  166.                     <% 'server name %>
  167.                         <td valign="bottom" align="left">
  168.                         <div class="bannerName" nowrap>
  169.                             <%= CreateTabTitle( g_strServerName ) %>
  170.                         </div>
  171.                     </td>
  172.                     <td valign="top" align="right">
  173.                          
  174.                     </td>
  175.                 </tr>
  176.                 </table>
  177.             </td>
  178.             <%
  179. if( FALSE = g_bSecureConnection ) then
  180. %>
  181.                 <script language="JavaScript">
  182.                     ShowHideSecureWarning( "img/not_secure_32.gif" );
  183.                 </script><%
  184. end if
  185. %>
  186.         </tr>
  187.         </table>
  188.     </td>
  189. </tr>
  190. </table>
  191. <p>
  192. <table width=100% cellspacing="0" cellpadding=4 border="0" >
  193. <tr>
  194.     <td>
  195.         <form name="pplist" AUTOCOMPLETE="OFF" onsubmit="JavaScript:return( false );">
  196.         <table cellspacing="0" cellpadding="0" border="1" width=100%>
  197.         <tr>
  198.         <td>
  199.         
  200.         <table cellspacing="0" cellpadding=3 border="0" width=100%>
  201.  
  202.         <tr class="colheader">
  203.             <Td width="16" valign="top"> </Td>
  204.             <Td valign="top" nowrap><span class="colheadertext" nowrap> <%= Server.HTMLEncode( L_NAME_TEXT ) %> </span></td>
  205.             <Td valign="top" nowrap><span class="colheadertext" nowrap> <%= Server.HTMLEncode( L_TYPE_TEXT ) %> </span></td>
  206.             <Td valign="top" nowrap><span class="colheadertext" nowrap> <%= Server.HTMLEncode( L_CONTENTLOCATION_TEXT ) %> </span></td>
  207.             <Td valign="top" nowrap><span class="colheadertext" nowrap> <%= Server.HTMLEncode( L_STATUS_TEXT ) %> </span></td>
  208.             <Td valign="top" nowrap><center><span class="colheadertext" nowrap><%= Server.HTMLEncode( L_PLAYERLIMITS_TEXT ) %> </span><div class="colheadertext"><%= L_PLAYERLIMITSLABEL_TEXT %></div></center></td>
  209.             <Td valign="top" nowrap><center><span class="colheadertext" nowrap><%= Server.HTMLEncode( L_BANDWIDTHLIMITS_TEXT ) %> </span><div class="colheadertext"><%= L_BWLIMITSLABEL_TEXT %></div></center></td>
  210.         </tr>
  211.                 
  212.         <%  
  213.         Dim iPPcount, i, dwListedPPIndex
  214.         Dim szInputName, strPPName, strPPID
  215.         Dim pp
  216.         Dim bPubPointIsStarted
  217.         Dim dwPubPointStatus 
  218.         Dim dwPubPointType
  219.         Dim bAllowClientsToConnect
  220.         Dim dwNumconnectedPlayers
  221.         Dim bPubPointChecked
  222.         Dim bThisItemChecked
  223.         Dim szPPToCheck, lPubPointIndexToCheck
  224.         Dim szbCheckedPPIsBroadcast
  225.         Dim szbCheckedPPIsStarted
  226.         Dim szbCheckedPPIsAllowingConnections
  227.         Dim szbCheckedPPHasConnectedClients
  228.         Dim strAltText
  229.         Dim bPush
  230.  
  231.         szbCheckedPPIsBroadcast = "false"
  232.         szbCheckedPPIsStarted = "false"
  233.         szbCheckedPPIsAllowingConnections = "false"
  234.         szbCheckedPPHasConnectedClients = "false"
  235.  
  236.         szPPIDToCheck = CStr( qs("ppID") )
  237.         if( 0 = Len( szPPIDToCheck ) ) then
  238. '            on error resume next
  239.             szPPToCheck = SafeUnescape( RemoveDangerousCharacters( qs("pp") ) )
  240.             lPubPointIndexToCheck = PPNameToIndex(g_objServer, szPPToCheck )
  241.             if( 0 <= lPubPointIndexToCheck ) then
  242.                 szPPIDToCheck = g_objServer.PublishingPoints( lPubPointIndexToCheck ).ID
  243.             end if
  244.         end if
  245.  
  246.         bPubPointChecked = FALSE
  247.         iPPcount = g_objServer.PublishingPoints.Count  
  248.         i = 0 
  249.         dwListedPPIndex = 0
  250.         
  251.         While (i < iPPcount) 
  252.             dwPubPointType = 0
  253.             dwPubPointStatus = 0
  254.             
  255.             set pp = g_objServer.PublishingPoints(i)
  256.             dwPubPointType = pp.Type
  257.             
  258.             if( WMS_PUBLISHING_POINT_TYPE_ON_DEMAND = dwPubPointType ) or ( WMS_PUBLISHING_POINT_TYPE_BROADCAST = dwPubPointType ) then
  259.  
  260.             strPPName = pp.name
  261.             if( 0 = StrComp( "/", strPPName, vbTextCompare ) ) then
  262.                 strPPName = L_DEFAULTPPNAME_TEXT
  263.             end if
  264.             strPPPath = TrimFileColon( pp.path )
  265.             strPPPath = URLDecode( strPPPath )
  266.  
  267.             strPPID = pp.ID
  268.             szInputName = i 
  269.             dwListedPPIndex = dwListedPPIndex + 1
  270.             bThisItemChecked = FALSE
  271.             
  272.             bAllowClientsToConnect = pp.AllowClientsToConnect
  273.             
  274.             if( WMS_PUBLISHING_POINT_TYPE_ON_DEMAND = dwPubPointType ) then
  275.                 dwPubPointStatus = pp.Status
  276.                 if bAllowClientsToConnect then
  277.                     bPubPointIsStarted = TRUE
  278.                 else
  279.                     bPubPointIsStarted = FALSE
  280.                 end if
  281.                 
  282.                 strAltText = InsertPPName( strPPName, L_CONFIGODPP_TEXT )
  283.                 if( FALSE = bAllowClientsToConnect ) then
  284.                     strAltText = FormatStatusString( strAltText, L_DENYING_TEXT )
  285. '               else
  286. '                   strAltText = FormatStatusString( strAltText, L_ALLOWING_TEXT )
  287.                 end if
  288.             else
  289.                 dwPubPointStatus = pp.BroadcastStatus
  290.                 if 0 <> ( WMS_BROADCAST_PUBLISHING_POINT_STARTED and dwPubPointStatus ) then 
  291.                     bPubPointIsStarted = TRUE
  292.                 else
  293.                     bPubPointIsStarted = FALSE
  294.                 end if
  295.                 
  296.                 bPush = CBool( 0 = StrComp( Left( strPPPath, 5 ), "push:" ) )
  297.                 if( bPush ) then
  298.                     strAltText = InsertPPName( strPPName, L_CONFIGBCPUSHPP_TEXT )
  299.                 else
  300.                     strAltText = InsertPPName( strPPName, L_CONFIGBCPP_TEXT )
  301.                 end if
  302.                 
  303.                 if( bPubPointIsStarted ) then
  304.                     if( FALSE = bAllowClientsToConnect ) then
  305.                         strAltText = FormatStatusString( strAltText, L_STARTEDBUTDENYING_TEXT )
  306.                     else
  307.                         strAltText = FormatStatusString( strAltText, L_PPISSTARTED_TEXT )
  308.                     end if
  309.                 else
  310.                     strAltText = FormatStatusString( strAltText, L_PPISSTOPPED_TEXT )
  311.                 end if
  312.             end if
  313.  
  314.             dwNumconnectedPlayers = pp.CurrentCounters.ConnectedPlayers
  315.         %>
  316.         <tr bgcolor="#ffffff"> 
  317.             <td width="16"><div class="small">
  318.                 <input 
  319.                     type="radio" 
  320.                     name="pp" 
  321.                     onClick="JavaScript:g_bAllow=<%= BoolToText( bAllowClientsToConnect ) %>;g_bConnectedClients=<%= BoolToText( 0 < dwNumconnectedPlayers ) %>;g_bBroadcast=<%= BoolToText( WMS_PUBLISHING_POINT_TYPE_ON_DEMAND <> dwPubPointType ) %>;g_bStarted=<%= BoolToText( bPubPointIsStarted ) %>;DrawCurrentToolbarSelection();"
  322.                     id="pp<%= iPPCount %>" 
  323.                     value="<%= Server.HTMLEncode( strPPID ) %>" 
  324.                     tabindex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> 
  325.                 <%
  326.                 if( 0 = StrComp( szPPIDToCheck, strPPID ) ) then %>
  327.                     checked <% 
  328.                     bPubPointChecked = TRUE
  329.                     bThisItemChecked = TRUE
  330.                 elseif ( ( "" = qs("ppID") ) and ( "" = qs("pp") ) and ( not bPubPointChecked ) ) then %>
  331.                     checked <%
  332.                     bPubPointChecked = TRUE
  333.                     bThisItemChecked = TRUE
  334.                 elseif ( iPPcount - 1 = i ) and ( not bPubPointChecked ) then %>
  335.                     checked <%
  336.                     bPubPointChecked = TRUE
  337.                     bThisItemChecked = TRUE
  338.                 end if
  339.                 
  340.                 ' Build button state for initial checked selection
  341.                 if( bThisItemChecked ) then
  342.                     if( WMS_PUBLISHING_POINT_TYPE_BROADCAST = dwPubPointType ) then
  343.                         szbCheckedPPIsBroadcast = "true"
  344.                         if( bPubPointIsStarted ) then
  345.                             szbCheckedPPIsStarted = "true"
  346.                         else
  347.                             szbCheckedPPIsStarted = "false"
  348.                         end if
  349.                     else
  350.                         szbCheckedPPIsBroadcast = "false"
  351.                         szbCheckedPPIsStarted = "false"
  352.                     end if
  353.                     
  354.                     if( bAllowClientsToConnect ) then
  355.                         szbCheckedPPIsAllowingConnections = "true"
  356.                     else
  357.                         szbCheckedPPIsAllowingConnections = "false"
  358.                     end if
  359.                     
  360.                     if( 0 < dwNumconnectedPlayers ) then
  361.                         szbCheckedPPHasConnectedClients = "true"
  362.                     else
  363.                         szbCheckedPPHasConnectedClients = "false"
  364.                     end if
  365.                 end if
  366.                 
  367.                 %> >
  368.             </div></td>
  369.  
  370.             <td>
  371.                 <label for="pp<%= iPPCount%>"><b><u><a href="pubpoint_status.asp?server=<%= g_strQueryStringServer %>&ppID=<%= strPPID %>" title="<%= strAltText %>" tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %> ><%= Server.HTMLEncode( ConvertPPName( strPPName, -1 ) )%></a><u></b></label>
  372.             </td>
  373.             <td>
  374.                 <div class="small">
  375.                 <%
  376.                 Select Case dwPubPointType
  377.                     Case WMS_PUBLISHING_POINT_TYPE_ON_DEMAND
  378.                     %><span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= Server.HTMLEncode( L_ONDEMAND_TEXT ) %></script><%
  379.                     Case WMS_PUBLISHING_POINT_TYPE_BROADCAST
  380.                     %><span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= Server.HTMLEncode( L_BROADCASTLCASE_TEXT ) %></script><%
  381.                     Case Else
  382.                 End Select
  383.                 %>
  384.                 </div>
  385.             </td>
  386.             <td >
  387.                 <div class="small" title="<%= Server.HTMLEncode( strPPPath ) %>"><%
  388.                 if( 0 = Len( strPPPath ) ) then
  389.                     strPPPath = " "
  390.                 end if
  391.                 %>
  392.                 <span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= Server.HTMLEncode( strPPPath ) %></script>
  393.                 </div>
  394.             </td>
  395.             <td >
  396.                 <div class="small">
  397.                 <% if WMS_PUBLISHING_POINT_TYPE_BROADCAST = dwPubPointType then %>
  398.                     <% if bPubPointIsStarted then %>
  399.                         <% if bAllowClientsToConnect then %>
  400.                         <span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= Server.HTMLEncode( L_STARTED_TEXT ) %></script>
  401.                         <% else %>
  402.                         <span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= Server.HTMLEncode( L_STARTEDDENYINGNEWCONNECTIONS_TEXT ) %></script>
  403.                         <% end if %>
  404.                     <% else %>
  405.                         <span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= Server.HTMLEncode( L_STOPPED_TEXT ) %></script>
  406.                     <% end if %>
  407.                                   
  408.                 <% else %>
  409.                     <% if bAllowClientsToConnect then %>
  410.                         <span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= Server.HTMLEncode( L_ALLOWINGNEWCONNECTIONS_TEXT ) %></script>
  411.                     <% else %>
  412.                         <span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= Server.HTMLEncode( L_DENYINGNEWCONNECTIONS_TEXT ) %></script>
  413.                     <% end if %>
  414.                 <% end if %>
  415.                 </div>
  416.             </td>
  417.             <td >
  418.                 <center>
  419.                 <table cellspacing="0" cellpadding=1>
  420.                     <tr>
  421.                         <td>
  422.                         <div class="small">
  423.                         <% 
  424.                         if BROADCAST = dwPubPointType then
  425.                             if bPubPointIsStarted then
  426.                             %><span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= PrettyPrintNumber( dwNumconnectedPlayers ) & " / " & PrettyPrintNumber( pp.Limits.ConnectedPlayers ) %></script><%
  427.                             else
  428.                             %><span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= " - / - " %></script><%
  429.                             end if
  430.                         else
  431.                             %><span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= PrettyPrintNumber( dwNumconnectedPlayers ) & " / " & PrettyPrintNumber( pp.Limits.ConnectedPlayers ) %></script><%
  432.                         end if
  433.                         %>
  434.                         </div>
  435.                         </td>
  436.                     </tr>
  437.                 </table>
  438.                 </center>
  439.             </td>
  440.             <td >
  441.                 <center>
  442.                 <table cellspacing="0" cellpadding="1" border="0">
  443.                     <tr>
  444.                         <td><div class="small">
  445.                         <% 
  446.                         if BROADCAST = dwPubPointType then
  447.                             if bPubPointIsStarted then
  448.                             %><span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= PrettyPrintBandwidth( CDbl( pp.CurrentCounters.PlayerAllocatedBandwidth ) ) & " / " & PrettyPrintBandwidth( pp.Limits.PlayerBandwidth ) %></script><%
  449.                             else
  450.                             %><span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= " - / - " %></script><%
  451.                             end if
  452.                         else
  453.                             %><span onClick="JavaScript:SimulateCheckedPP( <%= dwListedPPIndex - 1 %> );"><%= PrettyPrintBandwidth( CDbl( pp.CurrentCounters.PlayerAllocatedBandwidth ) ) & " / " & PrettyPrintBandwidth( pp.Limits.PlayerBandwidth ) %></script><%
  454.                         end if
  455.                         %>
  456.                         </div></td>
  457.                     </tr>
  458.                 </table>
  459.                 </center>
  460.             </td>
  461.         </tr>
  462.         <%
  463.           rem  rem if neither cache nor proxy
  464.           end if
  465.           i = i + 1 
  466.           Wend
  467.           if( ( not bPubPointChecked ) and ( 0 < dwListedPPIndex ) ) then
  468.                 bCheckFirstPubPoint = TRUE
  469.           end if
  470.         %> 
  471.  
  472.         </table>
  473.         
  474.         </td>
  475.         </tr>
  476.         </table>
  477.         
  478.         </form>
  479. </tr>
  480. <TR>
  481.     <TD>
  482.     </TD>
  483. </TR>
  484. <tr>
  485.     <td>
  486.         <%
  487.         ToolbarButtonText ( 0 ) = L_ADDPPBUTTON_TEXT
  488.         ToolbarButtonImage( 0 ) = IMAGE_PP_PPADD
  489.         ToolbarButtonLink ( 0 ) = "JavaScript:AddNew();"
  490.         ToolbarButtonAltText( 0 ) = L_BUTTONADDPUBPOINT_TEXT
  491.  
  492.         ToolbarButtonText ( 1 ) = L_BUTTONREMOVE_TEXT
  493.         ToolbarButtonImage( 1 ) = IMAGE_REMOVE
  494.         ToolbarButtonLink ( 1 ) = "JavaScript:Remove();"
  495.         ToolbarButtonAltText( 1 ) = L_REMOVEPP_TEXT
  496.             
  497.         ToolbarButtonText ( 2 ) = L_BUTTONSTART_TEXT
  498.         ToolbarButtonImage( 2 ) = IMAGE_PP_START
  499.         ToolbarButtonImageDisabled( 2 ) = IMAGE_PP_STARTG
  500.         ToolbarButtonLink ( 2 ) = "JavaScript:Start();"
  501.         ToolbarButtonAltText( 2 ) = L_STARTTHEPUBPOINT_TEXT
  502.             
  503.         ToolbarButtonText ( 3 ) = L_BUTTONSTOP_TEXT
  504.         ToolbarButtonImage( 3 ) = IMAGE_STOP
  505.         ToolbarButtonImageDisabled( 3 ) = IMAGE_STOPG
  506.         ToolbarButtonLink ( 3 ) = "JavaScript:Stop();"
  507.         ToolbarButtonAltText( 3 ) = L_STOPTHEPUBPOINT_TEXT
  508.             
  509.         ToolbarButtonText ( 4 ) = L_BUTTONALLOWNEWCONNECTIONS_TEXT
  510.         ToolbarButtonImage( 4 ) = IMAGE_ALLOWCONNECTIONS
  511.         ToolbarButtonLink ( 4 ) = "JavaScript:Allow();"
  512.         ToolbarButtonImageDisabled( 4 ) = IMAGE_ALLOWCONNECTIONSG
  513.         ToolbarButtonAltText( 4 ) = L_ALLOWUCONNECTIONS_TEXT
  514.  
  515.         ToolbarButtonText ( 5 ) = L_BUTTONDENYNEWCONNECTIONS_TEXT
  516.         ToolbarButtonImage( 5 ) = IMAGE_DENYCONNECTIONS
  517.         ToolbarButtonLink ( 5 ) = "JavaScript:Deny();"
  518.         ToolbarButtonImageDisabled( 5 ) = IMAGE_DENYCONNECTIONSG
  519.         ToolbarButtonAltText( 5 ) = L_DENYUCONNECTIONS_TEXT
  520.  
  521.         ToolbarButtonText ( 6 ) = L_DISCONNECTALLBUTTON_TEXT
  522.         ToolbarButtonImage( 6 ) = IMAGE_PP_DISCONNECT
  523.         ToolbarButtonLink ( 6 ) = "JavaScript:DisconnectAllClients()"
  524.         ToolbarButtonImageDisabled( 6 ) = IMAGE_PP_DISCONNECTG
  525.         ToolbarButtonAltText( 6 ) = L_DISCONNECT_TEXT
  526.  
  527.         ToolbarButtonText ( 7 ) = L_BUTTONRENAME_TEXT
  528.         ToolbarButtonImage( 7 ) = IMAGE_RENAME
  529.         ToolbarButtonLink ( 7 ) = "JavaScript:Rename();"
  530.         ToolbarButtonAltText( 7 ) = L_RENAMEPP_TEXT
  531.             
  532.         ToolbarButtonText ( 8 ) = L_BUTTONDUPLICATE_TEXT
  533.         ToolbarButtonImage( 8 ) = IMAGE_PP_DUP
  534.         ToolbarButtonLink ( 8 ) = "JavaScript:Duplicate();"
  535.         ToolbarButtonAltText( 8 ) = L_DUPPP_TEXT        
  536.         dwLastToolbarIndex = 8
  537.  
  538.     if( Session( "ShowServerList" ) ) then
  539.         dwLastToolbarIndex = dwLastToolbarIndex + 1
  540.         ToolbarButtonText ( dwLastToolbarIndex ) = L_BUTTONRETURNTOSERVERLIST_TEXT
  541.         ToolbarButtonImage( dwLastToolbarIndex ) = IMAGE_SERVERLIST
  542.         ToolbarButtonLink ( dwLastToolbarIndex ) = SERVERSLIST_PATH
  543.         ToolbarButtonAltText( dwLastToolbarIndex ) = L_RETURNTOSL_TEXT
  544.     end if
  545.  
  546.         dwLastToolbarIndex = dwLastToolbarIndex + 1
  547.         ToolbarButtonText ( dwLastToolbarIndex ) = L_BUTTONHELP_TEXT
  548.         ToolbarButtonImage( dwLastToolbarIndex ) = IMAGE_HELP
  549.         ToolbarButtonLink ( dwLastToolbarIndex ) = HELPTOKEN
  550.         ToolbarButtonAltText ( dwLastToolbarIndex ) = L_BUTTONHELP_TEXT
  551.         ToolbarHelpURL = H_PPDEFAULTHELPTOPIC
  552.         ToolbarNesting = H_PPLEVEL
  553.         %>
  554. <% DrawToolbar TRUE, ( dwLastToolbarIndex + 1 ) %>
  555.  
  556.     </td>
  557. </tr>
  558. </table>
  559. <%
  560.     DrawRefreshControl TRUE
  561.     DrawCopyrightInfo
  562.     AlertUserWithPopupErrorDialog
  563.  
  564.     if 0 <> Session( "ErrorNumber" ) then
  565.     %>
  566. <script language=JavaScript>
  567.     document.location = document.location<%
  568.         if 0 = Len( qs("ppID") ) then 
  569.             %> + "&ppID=<%= qs("ppID") %>"<% 
  570.         end if %>;
  571. </script><%
  572.     end if
  573.  
  574. '    OnErrorGoBack
  575. '    DrawStdFooter
  576. %>
  577. </body>
  578. <script language="JavaScript">
  579. <!--
  580. /*@cc_on @*/
  581.  
  582. var g_bBroadcast = <%= szbCheckedPPIsBroadcast %>;
  583. var g_bStarted = <%= szbCheckedPPIsStarted %>;
  584. var g_bAllow = <%= szbCheckedPPIsAllowingConnections %>;
  585. var g_bConnectedClients = <%= szbCheckedPPHasConnectedClients %>;
  586. var g_bStateInitialized = false;
  587.  
  588.  
  589. //////////////////////////////////////////////////////////////////////////
  590. function DrawCurrentToolbarSelection()
  591. {
  592.     <% jsTRY %>
  593. <%
  594.         if( bCheckFirstPubPoint ) then %>
  595.         if( ( ! g_bStateInitialized ) && document.pplist && document.pplist[ <%= dwListedPPIndex - 1 %> ] )
  596.         {
  597.             g_bStateInitialized = true;
  598.             document.pplist[ <%= dwListedPPIndex - 1 %> ].checked = true;
  599.             document.pplist[ <%= dwListedPPIndex - 1 %> ].click();
  600.         }<%
  601.         end if
  602.         %>
  603.         SetBroadcastMode( g_bBroadcast, g_bStarted );
  604.         SetConnectMode( g_bAllow );
  605.         SetDisconnectMode( g_bConnectedClients );
  606.         g_bToolbarLoaded = true;
  607.     <% jsCATCH %>
  608. }
  609.  
  610. //////////////////////////////////////////////////////////////////////////
  611. function SetBroadcastMode( bBroadcastPP, bPubPointIsStarted )
  612. {
  613.     <% jsTRY %>
  614.     g_bBroadcast = bBroadcastPP;
  615.     if( ! g_bBroadcast )
  616.     {
  617.         EnableToolbarItem( 2, false );
  618.         EnableToolbarItem( 3, false );
  619.     }
  620.     else
  621.     {
  622.         g_bStarted = bPubPointIsStarted;
  623.         EnableToolbarItem( 2, ! g_bStarted );
  624.         EnableToolbarItem( 3, g_bStarted );
  625.     }
  626.     <% jsCATCH %>
  627. }
  628.  
  629.  
  630. //////////////////////////////////////////////////////////////////////////
  631. function SetConnectMode( bAllowingNewConnections )
  632. {
  633.     <% jsTRY %>
  634.     g_bAllow = bAllowingNewConnections;
  635.     EnableToolbarItem( 4, ! g_bAllow );
  636.     EnableToolbarItem( 5, g_bAllow );
  637.     <% jsCATCH %>
  638. }
  639.  
  640.  
  641. //////////////////////////////////////////////////////////////////////////
  642. function SetDisconnectMode( bPlayersAreConnected )
  643. {
  644.     <% jsTRY %>
  645.     g_bConnectedClients = bPlayersAreConnected;
  646.     EnableToolbarItem( 6, g_bConnectedClients );
  647.     <% jsCATCH %>
  648. }
  649.  
  650.  
  651. //////////////////////////////////////////////////////////////////////////
  652. function SimulateCheckedPP( dwWhichItem )
  653. {
  654.     <% jsTRY %>
  655.     var e;
  656.  
  657.     e = document.pplist[ dwWhichItem ];
  658.     e.checked = true;
  659.     
  660.     return null;
  661.     <% jsCATCH %>
  662. }
  663.  
  664. //////////////////////////////////////////////////////////////////////////
  665. function GetCheckedItem()
  666. {
  667.     <% jsTRY %>
  668.     var i;
  669.     var e;
  670.  
  671.     for(i = 0; i < document.pplist.length; i++)
  672.     {
  673.         e = document.pplist[i];
  674.         if ( e.checked )
  675.         {  
  676.             return( e.value );
  677.         }
  678.     }
  679.     <% jsCATCH %>    
  680.     return null;
  681. }
  682.  
  683. //////////////////////////////////////////////////////////////////////////
  684. function AddNew()
  685. {
  686.     <% jsTRY %>
  687.     document.location = "pubpoint_add.asp?server=<%= g_strQueryStringServer %>&referrer=pplist&ppID=" + GetCheckedItem();
  688.     <% jsCATCH %>
  689. }
  690.  
  691. //////////////////////////////////////////////////////////////////////////
  692. function Remove()
  693. {
  694.     <% jsTRY %>
  695.     var szPubPointID;
  696.     
  697.     szPubPointID = GetCheckedItem();
  698.     if(szPubPointID != null)
  699.     {
  700.         if( true == window.confirm( "<%= RemoveDangerousCharacters( L_CONFIRMDELETEPUBPOINT_TEXT ) %>" ) )
  701.         {
  702.             document.location = "pp_action.asp?server=<%= g_strQueryStringServer %>" + "&ppID=" + SafeEscape( szPubPointID ) + "&op=delete&referrer=pubpoint_collection.asp" ;
  703.         }
  704.     }
  705.     else
  706.     {
  707.         window.alert( "<%= RemoveDangerousCharacters( L_PLEASESELECTAPUBPOINT_TEXT ) %>" );
  708.     }
  709.     <% jsCATCH %>
  710.  
  711. //////////////////////////////////////////////////////////////////////////
  712. function DisconnectAll()
  713. {
  714.     <% jsTRY %>
  715.     var szPubPointID;
  716.     
  717.     szPubPointID = GetCheckedItem();
  718.     if(szPubPointID != null)
  719.     {
  720.         document.location = "pp_action.asp?referrer=list&server=<%= g_strQueryStringServer %>&op=rampdown&ppID=" + SafeEscape( szPubPointID );
  721.     }
  722.     else
  723.     {
  724.         window.alert( "<%= RemoveDangerousCharacters( L_PLEASESELECTAPUBPOINT_TEXT ) %>" );
  725.     }
  726.     <% jsCATCH %>
  727.  
  728. //////////////////////////////////////////////////////////////////////////
  729. function Rename()
  730. {
  731.     <% jsTRY %>
  732.     var szNewName;
  733.     szNewName = "";
  734.     
  735.     var szInstance;
  736.     szInstance = GetCheckedItem();
  737.     if( null != szInstance )
  738.     {
  739.         document.location = "pubpoint_dialog.asp?server=<%= g_strQueryStringServer %>&op=rename&ppID=" + SafeEscape( szInstance );
  740.         return;
  741.     }
  742.     else
  743.     {
  744.         window.alert( " <%= RemoveDangerousCharacters( L_PLEASESELECTAPUBPT_TEXT ) %>" );
  745.     }
  746.     <% jsCATCH %>
  747. }
  748.   
  749. //////////////////////////////////////////////////////////////////////////
  750. function Duplicate()
  751. {
  752.     <% jsTRY %>
  753.     var szNewName;
  754.     szNewName = "";
  755.     
  756.     var szPubPointID;
  757.     szPubPointID = GetCheckedItem();
  758.     if( null != szPubPointID )
  759.     {
  760.         document.location = "pubpoint_dialog.asp?server=<%= g_strQueryStringServer %>&op=duplicate&ppID=" + szPubPointID;
  761.         return;
  762.     }
  763.     else
  764.     {
  765.         window.alert( " <%= RemoveDangerousCharacters( L_PLEASESELECTAPUBPT_TEXT ) %>" );
  766.     }
  767.     <% jsCATCH %>
  768. }
  769.  
  770. //////////////////////////////////////////////////////////////////////////
  771. function Start()
  772.     <% jsTRY %>
  773.     if( ( ! g_bBroadcast ) || g_bStarted )
  774.     {
  775.         return;
  776.     }
  777.     
  778.     var szPubPointID;
  779.     szPubPointID = GetCheckedItem();
  780.     if( szPubPointID != null )
  781.     {
  782.         document.location = "pp_action.asp?server=<%= g_strQueryStringServer %>&op=start&ppID=" + szPubPointID;
  783.     }
  784.     else
  785.     {
  786.         window.alert( "<%= RemoveDangerousCharacters( L_PLEASESELECTAPUBPOINT_TEXT ) %>" );
  787.     }
  788.     <% jsCATCH %>
  789.  
  790. //////////////////////////////////////////////////////////////////////////
  791. function Stop(szPubPointID, i)
  792. {
  793.     <% jsTRY %>
  794.     if( ( ! g_bBroadcast ) || ! g_bStarted )
  795.     {
  796.         return;
  797.     }
  798.     var szPubPointID;
  799.     szPubPointID = GetCheckedItem();
  800.     
  801.     if( szPubPointID != null )
  802.     {
  803.         document.location = "pp_action.asp?server=<%= g_strQueryStringServer %>&op=stop&ppID=" + szPubPointID;
  804.     }
  805.     else
  806.     {
  807.         window.alert( "<%= RemoveDangerousCharacters( L_PLEASESELECTAPUBPOINT_TEXT ) %>" );
  808.     }
  809.     <% jsCATCH %>
  810.  
  811. //////////////////////////////////////////////////////////////////////////
  812. function Deny()
  813.     <% jsTRY %>
  814.     if( ! g_bAllow )
  815.     {
  816.         return;
  817.     }
  818.     
  819.     var szPubPointID;
  820.     szPubPointID = GetCheckedItem();
  821.     
  822.     if( szPubPointID != null )
  823.     {
  824.         document.location = "pp_action.asp?server=<%= g_strQueryStringServer %>&op=deny&ppID=" + szPubPointID;
  825.     }
  826.     else
  827.     {
  828.         window.alert( "<%= RemoveDangerousCharacters( L_PLEASESELECTAPUBPOINT_TEXT ) %>" );
  829.     }
  830.     <% jsCATCH %>
  831.  
  832. //////////////////////////////////////////////////////////////////////////
  833. function DisconnectAllClients()
  834. {
  835.     <% jsTRY %>
  836.     if( !g_bConnectedClients )
  837.     {
  838.         return;
  839.     }
  840.     
  841.     if( true == window.confirm( "<%= RemoveDangerousCharacters( L_CONFIRMDISCONNECT_TEXT ) %>" ) )
  842.     {
  843.         var szPubPointID;
  844.         szPubPointID = GetCheckedItem();
  845.  
  846.         if( szPubPointID != null )
  847.         {
  848.             document.location = "pp_action.asp?server=<%= g_strQueryStringServer %>&op=rampdown&ppID=" + szPubPointID;
  849.         }
  850.         else
  851.         {
  852.             window.alert( "<%= RemoveDangerousCharacters( L_PLEASESELECTANODPUBPOINT_TEXT ) %>" );
  853.         }
  854.     }
  855.     <% jsCATCH %>
  856. }
  857.  
  858. //////////////////////////////////////////////////////////////////////////
  859. function Allow()
  860.     <% jsTRY %>
  861.     if( g_bAllow )
  862.     {
  863.         return;
  864.     }
  865.  
  866.     var szPubPointID;
  867.     szPubPointID = GetCheckedItem();
  868.     
  869.     if( szPubPointID != null )
  870.     {
  871.         document.location = "pp_action.asp?server=<%= g_strQueryStringServer %>&op=allow&ppID=" + szPubPointID;
  872.     }
  873.     else
  874.     {
  875.         window.alert( "<%= RemoveDangerousCharacters( L_PLEASESELECTAPUBPOINT_TEXT ) %>" );
  876.     }
  877.     <% jsCATCH %>
  878.  
  879. //////////////////////////////////////////////////////////////////////////
  880. function Refresh()
  881.     <% jsTRY %>
  882.     var szPubPointID;
  883.     szPubPointID = GetCheckedItem();
  884.     
  885.     if( szPubPointID != null )
  886.     {
  887.         document.location = "pubpoint_collection.asp?server=<%= g_strQueryStringServer %>&ppID=" + szPubPointID;
  888.     }
  889.     else
  890.     {
  891.         document.location = document.location;
  892.     }
  893.     <% jsCATCH %>
  894.  
  895. <% if ( brMSIE = g_dwBrowserType ) then %>
  896. //////////////////////////////////////////////////////////////////////////
  897. function HilightCurrentNode()
  898. {
  899.     <% jsTRY %>
  900.     <% if( 0 < Len( qs("bUpdateTree") ) ) then %>
  901.         return;
  902.     <% else %>
  903.         var childFrame;
  904.         var framesetHeader;
  905.  
  906.         if( window.parent && window.parent.parent )
  907.         {
  908.             framesetHeader = window.parent.parent;
  909.             if( ! framesetHeader.IsTreeReady() )
  910.             {
  911.                 setTimeout( "HilightCurrentNode();", 1000, "JavaScript" );
  912.                 return;
  913.             }
  914.         }
  915.  
  916.         if( window.parent && window.parent.frames && window.parent.frames[ "treeFrames" ] && window.parent.frames[ "treeFrames" ].frames )
  917.         {
  918.             childFrame = window.parent.frames[ "treeFrames" ].frames[ "frameTreeCode" ];
  919.         }
  920.  
  921.         if( childFrame )
  922.         {
  923.             if( childFrame.Initialized() )
  924.             {
  925.                 childFrame.SetSelectedNode( "pubpoints" );
  926.             }
  927.             else
  928.             {
  929.                 setTimeout( "HilightCurrentNode();", 1000, "JavaScript" );
  930.             }
  931.         }
  932.     <% end if %>
  933.     <% jsCATCH %>
  934. }
  935. <% end if %>
  936.  
  937. //////////////////////////////////////////////////////////////////////////
  938. function Initialize()
  939. {
  940. <% if ( brMSIE = g_dwBrowserType ) then %>
  941.     setTimeout( "HilightCurrentNode();", 50, "JavaScript" );
  942. <% end if %>
  943. }
  944. -->
  945. </script>
  946. </html>
  947. <%
  948. LatchCurrentPage "pubpoints/pubpoint_collection.asp", qs
  949. EndErrorHandling "pubpoint_collection.asp" 
  950.  
  951. on error resume next
  952. WMSServerHashASPCleanup
  953. WMSConnectASPCleanup
  954. %>
  955.